package com.xfatm.util.merge;

import java.util.HashMap;
import java.util.Map;

public class MergeExample {
    public static void main(String[] args){
        Map<String,String> map=new HashMap<>();
        map.put("test","1234");
        map.put("test2","12345");
        A obj=new A();
        try {
            MergeUtils.mergeObject(obj,map,"a=test,b=test2");
            System.out.println(obj.getA()+","+obj.getB());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static class A{
        private Integer a;

        private Integer b;

        public Integer getB() {
            return b;
        }

        public void setB(Integer b) {
            this.b = b;
        }

        public Integer getA() {
            return a;
        }

        public void setA(Integer a) {
            this.a = a;
        }
    }
}
